package demo11;
class  Student {
    private String name;
    private int age;
    public Student(){
        System.out.println("实例化了一个新的student对象。");
    }
    public Student(String name, int age) {
        this();//调用无参数的构造方法
        this.name = name;
        this.age = age;
    }
    public String read() {
        return "我是:" + name + ",年龄:" + age;
    }
}
public class Example11 {
    public static void main(String[] args) {
        Student stu=new Student("张三",18);//实例化student对象
        System.out.println(stu.read());
    }
}
